<template>
	<h3>cardReader 读卡 身份识别</h3>
	<f-card-reader
		class="w280"
		v-model:value="value"
		showValue="name"
		:isSearchPatient="false"
		@reader="changeReader"
		@select="changeSelect"
		@clear="changeClear"
	/>
	{{ value }}
	
	<div>
		<h3>身份证读取 readerSfzCard</h3>
		<f-button @click="handleReaderSfzCard">身份证读取</f-button>
		<pre>{{ restulReaderSfzCard }}</pre>
	</div>

	<div>
		<h3>密码键盘调用 sfzPwd</h3>
		<f-button @click="handlesfzPwd">密码键盘调用</f-button>
		<pre>{{ restulsfzPwd }}</pre>
	</div>

	<div>
		<h3>医保电子凭证读取 ybdzpz</h3>
		<f-input-textArea v-model:value="infoybdzpz" auto-size />
		<f-button @click="handleybdzpz">医保电子凭证读取</f-button>
		<pre>{{ restulybdzpz }}</pre>
	</div>

	<div>
		<h3>电子社保卡读取 dzsbk</h3>
		<f-button @click="handledzsbk">电子社保卡读取</f-button>
		<pre>{{ restuldzsbk }}</pre>
	</div>

	<div>
		<h3>社保卡验证密码 sbkVerifypin</h3>
		<f-button @click="handlesbkVerifypin">社保卡验证密码</f-button>
		<pre>{{ restulsbkVerifypin }}</pre>
	</div>

	<div>
		<h3>社保卡获取设备ID deviceIdGet</h3>
		<f-button @click="handledeviceIdGet">社保卡获取设备ID</f-button>
		<pre>{{ restuldeviceIdGet }}</pre>
	</div>

	<div>
		<h3>社保卡修改密码ID sbkChangePin</h3>
		<f-button @click="handlesbkChangePin">社保卡修改密码ID</f-button>
		<pre>{{ restulsbkChangePin }}</pre>
	</div>

	<div>
		<h3>刷脸获取医保用户身份授权ID ybdzpzFaceSwiping</h3>
		<f-input-textArea v-model:value="infoybdzpzFaceSwiping" auto-size />
		<f-button @click="handleybdzpzFaceSwiping">刷脸获取医保用户身份授权ID</f-button>
		<pre>{{ restulybdzpzFaceSwiping }}</pre>
	</div>

	<div>
		<h3>获取医保身份ID ybdzpzFaceSwiping_V2</h3>
		<f-input-textArea v-model:value="infoybdzpzFaceSwiping_V2" auto-size />
		<f-button @click="handleybdzpzFaceSwiping_V2">获取医保身份ID</f-button>
		<pre>{{ restulybdzpzFaceSwiping_V2 }}</pre>
	</div>
</template>

<script setup>
import { ref } from 'vue';
import { 
	readerSfzCard,
	sfzPwd,
	ybdzpz,
	dzsbk,
	sbkVerifypin,
	deviceIdGet,
	sbkChangePin,
	ybdzpzFaceSwiping,
	ybdzpzFaceSwiping_V2,
 } from '../../packages/index';

const value = ref();

const changeClear = (value) => {
	console.log('changeClear', value);
}
const changeReader = (type, data) => {
	console.log('changeReader', type, data);
}
const changeSelect = (value, option) => {
	console.log('changeSelect', value, option);
}

// 身份证读取
const restulReaderSfzCard = ref();
const handleReaderSfzCard = () => {
	readerSfzCard().then(res => {
		restulReaderSfzCard.value = res;
	});
}

// 密码键盘调用
const restulsfzPwd = ref();
const handlesfzPwd = () => {
	sfzPwd().then(res => {
		restulsfzPwd.value = res;
	});
}

// 医保电子凭证读取
const infoybdzpz = ref(`{
	data: {
		businessType: "见1.6码表",
		officeId: "32760",
		officeName: "消化内科",
		operatorId: "test001",
		operatorName: "超级管理员",
		orgId: "35020319001",
	},
	orgId: "35020319001",
	transType: "ec.query",
}`);
const restulybdzpz = ref();
const handleybdzpz = () => {
	ybdzpz(JSON.parse(JSON.stringify(infoybdzpz.value))).then(res => {
		restulybdzpz.value = res;
	});
}

// 医保电子凭证读取
const restuldzsbk = ref();
const handledzsbk = () => {
	dzsbk().then(res => {
		restuldzsbk.value = res;
	});
}

// 社保卡验证密码
const restulsbkVerifypin = ref();
const handlesbkVerifypin = () => {
	sbkVerifypin().then(res => {
		restulsbkVerifypin.value = res;
	});
}

// 社保卡获取设备ID
const restuldeviceIdGet = ref();
const handledeviceIdGet = () => {
	deviceIdGet().then(res => {
		restuldeviceIdGet.value = res;
	});
}

// 社保卡修改密码ID
const restulsbkChangePin = ref();
const handlesbkChangePin = () => {
	sbkChangePin().then(res => {
		restulsbkChangePin.value = res;
	});
}

// 刷脸获取医保用户身份授权ID
const infoybdzpzFaceSwiping = ref(`{
	data: {
		businessType: "01101",
		officeId: "32760",
		officeName: "消化内科",
		operatorId: "test001",
		operatorName: "超级管理员",
		orgId: "H54010200031",
		outBizNo: "20230703113226161753",
	},
	orgId: "H54010200031",
	transType: "cn.nhsa.ec.auth",
}`);
const restulybdzpzFaceSwiping = ref();
const handleybdzpzFaceSwiping = () => {
	ybdzpzFaceSwiping(JSON.parse(JSON.stringify(infoybdzpzFaceSwiping.value))).then(res => {
		restulybdzpzFaceSwiping.value = res;
	});
}

// 刷脸获取医保用户身份授权ID
const infoybdzpzFaceSwiping_V2 = ref(`{
	data: {
		authNo: "XXXXXX",
		businessType: "01101",
		officeId: "32760",
		officeName: "消化内科",
		operatorId: "test001",
		operatorName: "超级管理员",
		orgId: "H54010200031",
		outBizNo: "20230703115746072D9E",
	},
	orgId: "H54010200031",
	transType: "cn.nhsa.auth.check",
}`);
const restulybdzpzFaceSwiping_V2 = ref();
const handleybdzpzFaceSwiping_V2 = () => {
	ybdzpzFaceSwiping_V2(JSON.parse(JSON.stringify(infoybdzpzFaceSwiping_V2.value))).then(res => {
		restulybdzpzFaceSwiping_V2.value = res;
	});
}
</script>

<style lang="scss">

</style>
